package com.sky.service.impl;

import com.sky.service.ShopService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class ShopServiceImpl implements ShopService {

    @Autowired
    private RedisTemplate<String, Object> redisTemplate;

    /**
     * 根据状态设置店铺状态
     * @param status
     */
    @Override
    public void setStatus(String status) {
        redisTemplate.opsForValue().set("SHOP_STATUS",status);
    }

    /**
     * 获取店铺状态
     * @return
     */
    @Override
    public Object getStatus() {
        Object shopStatus = redisTemplate.opsForValue().get("SHOP_STATUS");
        return shopStatus;
    }
}
